package com.worldcup.dao;

import com.worldcup.model.Travel;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author duwan.zq
 */
@Mapper
@Repository
public interface TravelMapper {

    int deleteByPrimaryKey(Integer id);

    int insert(Travel record);

    int insertSelective(Travel record);

    Travel selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Travel record);

    int updateByPrimaryKey(Travel record);

    /**
     * 获取所有的用户openid
     * @return
     */
    List<String> getAllOpenid();

    /**
     * 获取指定openid、type的TravelList
     * @param openid
     * @param type
     * @return
     */
    List<Travel> getTravelListByOpenid(@Param("openid") String openid, @Param("type") Integer type);
}